package com.yanliang.blog.controller;

import com.yanliang.blog.pojo.Article;
import com.yanliang.blog.service.ArticleServie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ArticleController {

        @Autowired
        private ArticleServie articleService;

        @RequestMapping("/index")
        public String findTArticle(Model model, Integer pageNum ){
            Page<Article> articlePage = articleService.findTArticle(pageNum);
            model.addAttribute("data",articlePage);
            return "index";
        }
}
